﻿import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"
import "qrc:/qmlComponents/AxisModulePos"
import "qrc:/qmlComponents/VisionViewer"
import "qrc:/qmlComponents/CustomizedUIElement/RowColumnSelectorView"

Item {
    ColumnLayout{
        spacing: 30

        RowLayout{
            RowColumnSelector{
                rowColInfo: rtRowColInfo
            }

            Button{
                text: qsTr("MoveToRejectSensorPos")
                onClicked: {
                    tem.runSingleCmd(pickArm, "moveToRejectSensorPos",
                                     [rtRowColInfo.unitRow, rtRowColInfo.unitColumn, rtRowColInfo.row, rtRowColInfo.column])
                }
            }
        }

        XYZModulePos{
            moduleName: "SUTXYZ"
            posName: "UnloadNgSenserPos"
        }

        RowLayout{
            SAxisModulePos{
                moduleName: "PickArmY"
                posName: "PickNgSensorPos"
            }

            ColumnLayout{
                ConfigRow{
                    configModel: paConfig
                    configName: "rejectUseSoftLand"
                    Component.onCompleted: {
                        autoInit()
                    }
                }

                Button{
                    text: qsTr("Get_NG_Sensor")
                    onClicked: {
                        tem.runSingleCmd(pickArm, "moveToGetRejectSensor")
                    }
                }
            }
        }

        RowLayout{
            XYModulePos{
                moduleName: "PickArmXY"
                posName: "PlaceNgSensorPos"
            }

            Button{
                text: qsTr("Place_NG_Sensor")
                onClicked: {
                    tem.runSingleCmd(pickArm, "moveToPlaceRejectSensor",
                                     [rtRowColInfo.unitRow, rtRowColInfo.unitColumn, rtRowColInfo.row, rtRowColInfo.column])
                }
            }
        }
    }
}
